<?php

    $id = $_GET['id'];

    if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {
        # code...

        $sql = "select * from `cate` where `pid` =$id";
        $result = mysqli_query($link,$sql);
        $data = mysqli_fetch_assoc($result);
        echo empty($data)?0:1;die;
    }

    getcateDel($link,$id);
    $_rows = mysqli_affected_rows($link);
    if ($_rows > 0) {
        echo '<script type="text/javascript">alert("删除成功！");self.location.href="index.php?c=cate&a=list&admin=1";</script>';die;
    }else{
        echo '<script type="text/javascript">alert("删除失败！");history.go(-1);</script>';die;
    }



?>
